extends Button


# Declare member variables here. Examples:
# var a = 2
# var b = "text"
enum MODE {
	NONE_MODE,
	CG_MODE,
	MUSIC_MODE
}
var _mode = MODE.NONE_MODE

# Called when the node enters the scene tree for the first time.
func _ready():
	Model.library = self
	pass # Replace with function body.

# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
#	pass

func setCgMode():
	get_node("cgMode/light").visible = true
	get_node("musicMode/light").visible = false
	get_node("pageControl").setTips('CG鉴赏', 1, 10)
	get_node("cgPreview").visible = true
	get_node("musicPreview").visible = false
	_mode = MODE.CG_MODE
	pass

func setMusicMode():
	get_node("cgMode/light").visible = false
	get_node("musicMode/light").visible = true
	get_node("pageControl").setTips('音乐鉴赏', 1, 10)
	get_node("cgPreview").visible = false
	get_node("musicPreview").visible = true
	_mode = MODE.MUSIC_MODE
	pass

func _on_back_pressed():
	get_node(".").visible = false
	pass # Replace with function body.

func _on_backTitle_pressed():
	get_node(".").visible = false
	Worker.toLogo()
	pass # Replace with function body.

func _on_cgMode_button_down():
	if _mode == MODE.CG_MODE:
		return
	setCgMode()
	pass # Replace with function body.

func _on_musicMode_button_down():
	if _mode == MODE.MUSIC_MODE:
		return
	setMusicMode()
	pass # Replace with function body.
